#include <sys_config.h>
#include <basic_types.h>
#include <mediatypes.h>
#include <api/libc/alloc.h>
#include <api/libc/printf.h>
#include <api/libc/string.h>
#include <osal/osal.h>
#include <hld/hld_dev.h>
#include <hld/crypto/crypto.h>


RET_CODE ce_open(pCE_DEVICE pCeDev)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ret ;
   if(pCeDev->open)
   {
      ret = pCeDev->open(pCeDev);
   }

   return ret ;
}

RET_CODE ce_close(pCE_DEVICE pCeDev)
{
   RET_CODE ret = RET_FAILURE;
     
   if(pCeDev == NULL)
     return ret ;
   if(pCeDev->close)
   {
      ret = pCeDev->close(pCeDev);
   }

   return ret ;
}

RET_CODE ce_ioctl(pCE_DEVICE pCeDev,UINT32 cmd,UINT32 param)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ret ;
   if(pCeDev->ioctl)
   {
      ret = pCeDev->ioctl( pCeDev, cmd, param);
   }

   return ret ;
}

RET_CODE ce_key_generate(pCE_DEVICE pCeDev,pCE_DATA_INFO pCe_data_info)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ret ;
   if(pCeDev->key_generate)
   {
      ret = pCeDev->key_generate( pCeDev,pCe_data_info);
   }
   return ret ;
}

RET_CODE ce_key_load(pCE_DEVICE pCeDev,pOTP_PARAM pCe_opt_info)
{
   RET_CODE ret = RET_FAILURE;

   if(pCeDev == NULL)
     return ret ;
   if(pCeDev->key_load)
   {
      ret = pCeDev->key_load( pCeDev,pCe_opt_info);
   }

   return ret ;
}

